//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __PowerManager_H__
#define __PowerManager_H__

class PowerManager: public CDeviceDriver {
public:
    CARAPI Read(
        /* [in] */ Int64 u64Offset,
       /* [in] */ Int32 bytesToRead,
        /* [out] */ MemoryBuf * pBuffer,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Write(
        /* [in] */ Int64 u64Offset,
        /* [in] */ const MemoryBuf &buffer,
        /* [out] */ Int32 * pBytesWritten,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Control(
        /* [in] */ Handle32 nControlCode,
        /* [in] */ const MemoryBuf &inBuffer,
        /* [out] */ MemoryBuf * pOutBuffer,
        /* [out] */ IEvent * * ppCompletionEvent);

    virtual void Dispose() {}
};

EXTERN void ShowDeviceStatus();
void PoSetCpuPowerOn(Boolean PowerOn);
void PoSetCameraPowerOn(Boolean PowerOn);
void  PoSetLcdPowerOn(Boolean PowerOn);
void PoSetAudioPowerOn(Boolean PowerOn);
unsigned long PoGetLcdPowerPolicy();
unsigned long PoGetLcdPowerMode();
void EnterSleepModeCallback(int eType, int nCode, void *pParam);
void WakeFromSleepModeCallback(int eType, int nCode, void * pParam);
void EnterIdleModeNotify(int eType, int nCode, void *pParam);
void LockScreenNotify(int eType, int nCode, void *pParam);
void PoSetLcdPoweroffInterval(int interval);
unsigned long PoGetBootStatus();
void PoSetLcdChangeModePorc(TimerCallBackProc proc);
TimerCallBackProc PoGetLcdChangeModePorc();
void setWatchDog(int mSec);
void pcf50606_power_off(void);
void PoEventHandler(void * pArg);
extern"C" void DM_NotifyInput(int eType, int nCode, void *pParam);
void PoSetBtPowerPolicy(void * pArg);
#endif//

